
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Introduction to atomman: Point defect generation &#8212; atomman 1.4.0 documentation</title>
    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Introduction to atomman: Free surface generator" href="4.2._Free_surface_generator.html" />
    <link rel="prev" title="Introduction to atomman: Defect creation and analysis" href="4._Defect_creation_and_analysis.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="4.2._Free_surface_generator.html" title="Introduction to atomman: Free surface generator"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="4._Defect_creation_and_analysis.html" title="Introduction to atomman: Defect creation and analysis"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Tutorials</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  
<style>
/* CSS for nbsphinx extension */

/* remove conflicting styling from Sphinx themes */
div.nbinput.container div.prompt *,
div.nboutput.container div.prompt *,
div.nbinput.container div.input_area pre,
div.nboutput.container div.output_area pre,
div.nbinput.container div.input_area .highlight,
div.nboutput.container div.output_area .highlight {
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

div.nbinput.container > div[class*=highlight],
div.nboutput.container > div[class*=highlight] {
    margin: 0;
}

div.nbinput.container div.prompt *,
div.nboutput.container div.prompt * {
    background: none;
}

div.nboutput.container div.output_area .highlight,
div.nboutput.container div.output_area pre {
    background: unset;
}

div.nboutput.container div.output_area div.highlight {
    color: unset;  /* override Pygments text color */
}

/* avoid gaps between output lines */
div.nboutput.container div[class*=highlight] pre {
    line-height: normal;
}

/* input/output containers */
div.nbinput.container,
div.nboutput.container {
    display: -webkit-flex;
    display: flex;
    align-items: flex-start;
    margin: 0;
    width: 100%;
}
@media (max-width: 540px) {
    div.nbinput.container,
    div.nboutput.container {
        flex-direction: column;
    }
}

/* input container */
div.nbinput.container {
    padding-top: 5px;
}

/* last container */
div.nblast.container {
    padding-bottom: 5px;
}

/* input prompt */
div.nbinput.container div.prompt pre {
    color: #307FC1;
}

/* output prompt */
div.nboutput.container div.prompt pre {
    color: #BF5B3D;
}

/* all prompts */
div.nbinput.container div.prompt,
div.nboutput.container div.prompt {
    width: 4.5ex;
    padding-top: 5px;
    position: relative;
    user-select: none;
}

div.nbinput.container div.prompt > div,
div.nboutput.container div.prompt > div {
    position: absolute;
    right: 0;
    margin-right: 0.3ex;
}

@media (max-width: 540px) {
    div.nbinput.container div.prompt,
    div.nboutput.container div.prompt {
        width: unset;
        text-align: left;
        padding: 0.4em;
    }
    div.nboutput.container div.prompt.empty {
        padding: 0;
    }

    div.nbinput.container div.prompt > div,
    div.nboutput.container div.prompt > div {
        position: unset;
    }
}

/* disable scrollbars on prompts */
div.nbinput.container div.prompt pre,
div.nboutput.container div.prompt pre {
    overflow: hidden;
}

/* input/output area */
div.nbinput.container div.input_area,
div.nboutput.container div.output_area {
    -webkit-flex: 1;
    flex: 1;
    overflow: auto;
}
@media (max-width: 540px) {
    div.nbinput.container div.input_area,
    div.nboutput.container div.output_area {
        width: 100%;
    }
}

/* input area */
div.nbinput.container div.input_area {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    /*background: #f5f5f5;*/
}

/* override MathJax center alignment in output cells */
div.nboutput.container div[class*=MathJax] {
    text-align: left !important;
}

/* override sphinx.ext.imgmath center alignment in output cells */
div.nboutput.container div.math p {
    text-align: left;
}

/* standard error */
div.nboutput.container div.output_area.stderr {
    background: #fdd;
}

/* ANSI colors */
.ansi-black-fg { color: #3E424D; }
.ansi-black-bg { background-color: #3E424D; }
.ansi-black-intense-fg { color: #282C36; }
.ansi-black-intense-bg { background-color: #282C36; }
.ansi-red-fg { color: #E75C58; }
.ansi-red-bg { background-color: #E75C58; }
.ansi-red-intense-fg { color: #B22B31; }
.ansi-red-intense-bg { background-color: #B22B31; }
.ansi-green-fg { color: #00A250; }
.ansi-green-bg { background-color: #00A250; }
.ansi-green-intense-fg { color: #007427; }
.ansi-green-intense-bg { background-color: #007427; }
.ansi-yellow-fg { color: #DDB62B; }
.ansi-yellow-bg { background-color: #DDB62B; }
.ansi-yellow-intense-fg { color: #B27D12; }
.ansi-yellow-intense-bg { background-color: #B27D12; }
.ansi-blue-fg { color: #208FFB; }
.ansi-blue-bg { background-color: #208FFB; }
.ansi-blue-intense-fg { color: #0065CA; }
.ansi-blue-intense-bg { background-color: #0065CA; }
.ansi-magenta-fg { color: #D160C4; }
.ansi-magenta-bg { background-color: #D160C4; }
.ansi-magenta-intense-fg { color: #A03196; }
.ansi-magenta-intense-bg { background-color: #A03196; }
.ansi-cyan-fg { color: #60C6C8; }
.ansi-cyan-bg { background-color: #60C6C8; }
.ansi-cyan-intense-fg { color: #258F8F; }
.ansi-cyan-intense-bg { background-color: #258F8F; }
.ansi-white-fg { color: #C5C1B4; }
.ansi-white-bg { background-color: #C5C1B4; }
.ansi-white-intense-fg { color: #A1A6B2; }
.ansi-white-intense-bg { background-color: #A1A6B2; }

.ansi-default-inverse-fg { color: #FFFFFF; }
.ansi-default-inverse-bg { background-color: #000000; }

.ansi-bold { font-weight: bold; }
.ansi-underline { text-decoration: underline; }


div.nbinput.container div.input_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight].math,
div.nboutput.container div.output_area.rendered_html,
div.nboutput.container div.output_area > div.output_javascript,
div.nboutput.container div.output_area:not(.rendered_html) > img{
    padding: 5px;
    margin: 0;
}

/* fix copybtn overflow problem in chromium (needed for 'sphinx_copybutton') */
div.nbinput.container div.input_area > div[class^='highlight'],
div.nboutput.container div.output_area > div[class^='highlight']{
    overflow-y: hidden;
}

/* hide copybtn icon on prompts (needed for 'sphinx_copybutton') */
.prompt a.copybtn {
    display: none;
}

/* Some additional styling taken form the Jupyter notebook CSS */
div.rendered_html table {
  border: none;
  border-collapse: collapse;
  border-spacing: 0;
  color: black;
  font-size: 12px;
  table-layout: fixed;
}
div.rendered_html thead {
  border-bottom: 1px solid black;
  vertical-align: bottom;
}
div.rendered_html tr,
div.rendered_html th,
div.rendered_html td {
  text-align: right;
  vertical-align: middle;
  padding: 0.5em 0.5em;
  line-height: normal;
  white-space: normal;
  max-width: none;
  border: none;
}
div.rendered_html th {
  font-weight: bold;
}
div.rendered_html tbody tr:nth-child(odd) {
  background: #f5f5f5;
}
div.rendered_html tbody tr:hover {
  background: rgba(66, 165, 245, 0.2);
}
</style>
<div class="section" id="Introduction-to-atomman:-Point-defect-generation">
<h1>Introduction to atomman: Point defect generation<a class="headerlink" href="#Introduction-to-atomman:-Point-defect-generation" title="Permalink to this headline">¶</a></h1>
<p><strong>Lucas M. Hale</strong>, <a class="reference external" href="mailto:lucas&#46;hale&#37;&#52;&#48;nist&#46;gov?Subject=ipr-demo">lucas<span>&#46;</span>hale<span>&#64;</span>nist<span>&#46;</span>gov</a>, <em>Materials Science and Engineering Division, NIST</em>.</p>
<p><a class="reference external" href="http://www.nist.gov/public_affairs/disclaimer.cfm">Disclaimers</a></p>
<div class="section" id="1.-Introduction">
<h2>1. Introduction<a class="headerlink" href="#1.-Introduction" title="Permalink to this headline">¶</a></h2>
<p>This Notebook provides an introduction to tools in atomman for generating point defects.</p>
<p><strong>Library Imports</strong></p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Standard libraries</span>
<span class="kn">import</span> <span class="nn">datetime</span>

<span class="c1"># http://www.numpy.org/</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>

<span class="c1"># https://github.com/usnistgov/atomman</span>
<span class="kn">import</span> <span class="nn">atomman</span> <span class="k">as</span> <span class="nn">am</span>
<span class="kn">import</span> <span class="nn">atomman.unitconvert</span> <span class="k">as</span> <span class="nn">uc</span>

<span class="c1"># Show atomman version</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;atomman version =&#39;</span><span class="p">,</span> <span class="n">am</span><span class="o">.</span><span class="n">__version__</span><span class="p">)</span>

<span class="c1"># Show date of Notebook execution</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Notebook executed on&#39;</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="o">.</span><span class="n">today</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
atomman version = 1.4.0
Notebook executed on 2021-08-05
</pre></div></div>
</div>
<p>Define 2x2x2 CsCl supercell for testing</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">atoms</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Atoms</span><span class="p">(</span><span class="n">atype</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">],</span> <span class="n">pos</span><span class="o">=</span><span class="p">[[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],[</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">]],</span> <span class="n">charge</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">])</span>
<span class="n">alat</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">4.11</span><span class="p">,</span> <span class="s1">&#39;angstrom&#39;</span><span class="p">)</span>
<span class="n">box</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Box</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="n">alat</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="n">alat</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="n">alat</span><span class="p">)</span>
<span class="n">ucell</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">System</span><span class="p">(</span><span class="n">atoms</span><span class="o">=</span><span class="n">atoms</span><span class="p">,</span> <span class="n">box</span><span class="o">=</span><span class="n">box</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">ucell</span><span class="o">.</span><span class="n">supersize</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span>

<span class="c1"># Print system information</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natoms =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">natoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natypes =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 8.220,  0.000,  0.000]
bvect =  [ 0.000,  8.220,  0.000]
cvect =  [ 0.000,  0.000,  8.220]
origin = [ 0.000,  0.000,  0.000]
natoms = 16
natypes = 2
</pre></div></div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
      <th>charge</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>3</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>5</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
    </tr>
    <tr>
      <td>6</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>7</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
    </tr>
    <tr>
      <td>8</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>9</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
    </tr>
    <tr>
      <td>10</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>11</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
    </tr>
    <tr>
      <td>12</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>13</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
    </tr>
    <tr>
      <td>14</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
    </tr>
    <tr>
      <td>15</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
</div>
<div class="section" id="2.-atomman.defect.vacancy()">
<h2>2. atomman.defect.vacancy()<a class="headerlink" href="#2.-atomman.defect.vacancy()" title="Permalink to this headline">¶</a></h2>
<p>Generates a new system by adding a vacancy point defect.</p>
<ol class="arabic simple">
<li><p>Removes the indicated atom from the system</p></li>
<li><p>Adds per-atom property old_id if it doesn’t exist corresponding to the atom ids in the original system.</p></li>
</ol>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>system</strong> (<em>atomman.System</em>) The base System to add the defect to.</p></li>
<li><p><strong>pos</strong> (<em>array-like object, optional</em>) Position of the atom to be removed. Either pos or ptd_id must be given.</p></li>
<li><p><strong>ptd_id</strong> (<em>int, optional</em>) Id of the atom to be removed. Either pos or ptd_id must be given.</p></li>
<li><p><strong>scale</strong> (<em>bool, optional</em>) Indicates if pos is Cartesian (False) or box-relative (True). Default value is False.</p></li>
<li><p><strong>atol</strong> (<em>float, optional</em>) Absolute tolerance for position-based searching. Default value is 1e-3 angstroms.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.System</em>) A new system with the vacancy added.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Add a vacancy by deleting atom 5</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">vacancy</span><span class="p">(</span><span class="n">system</span><span class="p">,</span> <span class="n">ptd_id</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>

<span class="c1"># Add a second vacancy by deleting atom at position [0.00, 4.110, 4.110]</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">vacancy</span><span class="p">(</span><span class="n">d_system</span><span class="p">,</span> <span class="n">pos</span><span class="o">=</span><span class="p">[</span><span class="mf">0.00</span><span class="p">,</span> <span class="mf">4.11</span><span class="p">,</span> <span class="mf">4.11</span><span class="p">])</span>

<span class="c1"># Print system information</span>
<span class="nb">print</span><span class="p">(</span><span class="n">d_system</span><span class="o">.</span><span class="n">box</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natoms =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natypes =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="n">d_system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 8.220,  0.000,  0.000]
bvect =  [ 0.000,  8.220,  0.000]
cvect =  [ 0.000,  0.000,  8.220]
origin = [ 0.000,  0.000,  0.000]
natoms = 14
natypes = 2
</pre></div></div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
      <th>charge</th>
      <th>old_id</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>0</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>1</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>2</td>
    </tr>
    <tr>
      <td>3</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>3</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>4</td>
    </tr>
    <tr>
      <td>5</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>6</td>
    </tr>
    <tr>
      <td>6</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>7</td>
    </tr>
    <tr>
      <td>7</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>8</td>
    </tr>
    <tr>
      <td>8</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>9</td>
    </tr>
    <tr>
      <td>9</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>10</td>
    </tr>
    <tr>
      <td>10</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>11</td>
    </tr>
    <tr>
      <td>11</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>13</td>
    </tr>
    <tr>
      <td>12</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>14</td>
    </tr>
    <tr>
      <td>13</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>15</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
</div>
<div class="section" id="3.-atomman.defect.interstitial()">
<h2>3. atomman.defect.interstitial()<a class="headerlink" href="#3.-atomman.defect.interstitial()" title="Permalink to this headline">¶</a></h2>
<p>Generates a new system by adding a vacancy point defect.</p>
<ol class="arabic simple">
<li><p>Adds a new atom to the end of the Atoms list.</p></li>
<li><p>Adds per-atom property old_id if it doesn’t exist corresponding to the atom ids in the original system.</p></li>
<li><p>Sets any of the new atom’s per-atom properties to values given as kwargs. Any undefined properties are given zero values except atype, which is set to 1.</p></li>
</ol>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>system</strong> (<em>atomman.System</em>) The base System to add the defect to.</p></li>
<li><p><strong>pos</strong> (<em>array-like object</em>) Position of the atom being added.</p></li>
<li><p><strong>scale</strong> (<em>bool, optional</em>) Indicates if pos is Cartesian (False) or box-relative (True). Default value is False.</p></li>
<li><p><strong>atol</strong> (<em>float, optional</em>) Absolute tolerance for position-based searching. Default value is 1e-3 angstroms.</p></li>
<li><p><strong>**kwargs</strong> (<em>any, optional</em>) Keyword arguments corresponding to per-atom property values for the new atom. By default, atype==1 and all other properties are set to be all zeros for the property’s shape.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.System</em>) A new system with the interstitial added.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[4]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Add interstitial at pos = [1.515, 1.515, 0.000] without defining atype, charge</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">interstitial</span><span class="p">(</span><span class="n">system</span><span class="p">,</span> <span class="n">pos</span><span class="o">=</span><span class="p">[</span><span class="mf">1.515</span><span class="p">,</span> <span class="mf">1.515</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">])</span>

<span class="c1"># Add second interstitial at pos = [1.515, 4.545, 0.000] with defining atype, charge</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">interstitial</span><span class="p">(</span><span class="n">d_system</span><span class="p">,</span> <span class="n">pos</span><span class="o">=</span><span class="p">[</span><span class="mf">1.515</span><span class="p">,</span> <span class="mf">4.545</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="n">atype</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">charge</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="c1"># Print system information</span>
<span class="nb">print</span><span class="p">(</span><span class="n">d_system</span><span class="o">.</span><span class="n">box</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natoms =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natypes =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="n">d_system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 8.220,  0.000,  0.000]
bvect =  [ 0.000,  8.220,  0.000]
cvect =  [ 0.000,  0.000,  8.220]
origin = [ 0.000,  0.000,  0.000]
natoms = 18
natypes = 2
</pre></div></div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[4]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
      <th>charge</th>
      <th>old_id</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>0</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>1</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>2</td>
    </tr>
    <tr>
      <td>3</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>3</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>4</td>
    </tr>
    <tr>
      <td>5</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>5</td>
    </tr>
    <tr>
      <td>6</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>6</td>
    </tr>
    <tr>
      <td>7</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>7</td>
    </tr>
    <tr>
      <td>8</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>8</td>
    </tr>
    <tr>
      <td>9</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>9</td>
    </tr>
    <tr>
      <td>10</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>10</td>
    </tr>
    <tr>
      <td>11</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>11</td>
    </tr>
    <tr>
      <td>12</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>12</td>
    </tr>
    <tr>
      <td>13</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>13</td>
    </tr>
    <tr>
      <td>14</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>14</td>
    </tr>
    <tr>
      <td>15</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>15</td>
    </tr>
    <tr>
      <td>16</td>
      <td>1</td>
      <td>1.515</td>
      <td>1.515</td>
      <td>0.000</td>
      <td>0.0</td>
      <td>16</td>
    </tr>
    <tr>
      <td>17</td>
      <td>2</td>
      <td>1.515</td>
      <td>4.545</td>
      <td>0.000</td>
      <td>1.0</td>
      <td>17</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
</div>
<div class="section" id="4.-atomman.defect.substitutional()">
<h2>4. atomman.defect.substitutional()<a class="headerlink" href="#4.-atomman.defect.substitutional()" title="Permalink to this headline">¶</a></h2>
<p>Generates a new system by adding a substitutional point defect.</p>
<ol class="arabic simple">
<li><p>Moves the indicated atom to the end of the list and changes its atype to the value given.</p></li>
<li><p>Adds per-atom property old_id if it doesn’t exist corresponding to the atom ids in the original system.</p></li>
<li><p>Sets any of the moved atom’s per-atom properties to values given as kwargs. Any undefined properties are left unchanged.</p></li>
</ol>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>system</strong> (<em>atomman.System</em>) The base System to add the defect to.</p></li>
<li><p><strong>pos</strong> (<em>array-like object, optional</em>) Position of the atom being modified. Either pos or ptd_id must be given.</p></li>
<li><p><strong>ptd_id</strong> (<em>int, optional</em>) Id of the atom to be modified. Either pos or ptd_id must be given.</p></li>
<li><p><strong>atype</strong> (<em>int, optional</em>) Integer atomic type to change the identified atom to. Must be different than the atom’s current id. Default value is 1.</p></li>
<li><p><strong>scale</strong> (<em>bool, optional</em>) Indicates if pos is Cartesian (False) or box-relative (True). Default value is False.</p></li>
<li><p><strong>atol</strong> (<em>float, optional</em>) Absolute tolerance for position-based searching. Default value is 1e-3 angstroms.</p></li>
<li><p><strong>**kwargs</strong> (<em>any, optional</em>) Keyword arguments corresponding to per-atom property values for the modified atom. By default, all properties (except atype) are left unchanged.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.System</em>) A new system with the substitutional added.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Make atom 1 a substitutional without changing charge</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">substitutional</span><span class="p">(</span><span class="n">system</span><span class="p">,</span> <span class="n">ptd_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">atype</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>

<span class="c1"># Add second substitutional at pos = [0.00, 4.11, 4.11] and change charge</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">substitutional</span><span class="p">(</span><span class="n">d_system</span><span class="p">,</span> <span class="n">pos</span><span class="o">=</span><span class="p">[</span><span class="mf">0.00</span><span class="p">,</span> <span class="mf">4.11</span><span class="p">,</span> <span class="mf">4.11</span><span class="p">],</span> <span class="n">atype</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">charge</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="c1"># Print system information</span>
<span class="nb">print</span><span class="p">(</span><span class="n">d_system</span><span class="o">.</span><span class="n">box</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natoms =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natypes =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="n">d_system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 8.220,  0.000,  0.000]
bvect =  [ 0.000,  8.220,  0.000]
cvect =  [ 0.000,  0.000,  8.220]
origin = [ 0.000,  0.000,  0.000]
natoms = 16
natypes = 3
</pre></div></div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
      <th>charge</th>
      <th>old_id</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>0</td>
    </tr>
    <tr>
      <td>1</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>2</td>
    </tr>
    <tr>
      <td>2</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>3</td>
    </tr>
    <tr>
      <td>3</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>4</td>
    </tr>
    <tr>
      <td>4</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>5</td>
    </tr>
    <tr>
      <td>5</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>6</td>
    </tr>
    <tr>
      <td>6</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>7</td>
    </tr>
    <tr>
      <td>7</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>8</td>
    </tr>
    <tr>
      <td>8</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>9</td>
    </tr>
    <tr>
      <td>9</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>10</td>
    </tr>
    <tr>
      <td>10</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>11</td>
    </tr>
    <tr>
      <td>11</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>13</td>
    </tr>
    <tr>
      <td>12</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>14</td>
    </tr>
    <tr>
      <td>13</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>15</td>
    </tr>
    <tr>
      <td>14</td>
      <td>3</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>1</td>
    </tr>
    <tr>
      <td>15</td>
      <td>2</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>1.0</td>
      <td>12</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
</div>
<div class="section" id="5.-atomman.defect.dumbbell()">
<h2>5. atomman.defect.dumbbell()<a class="headerlink" href="#5.-atomman.defect.dumbbell()" title="Permalink to this headline">¶</a></h2>
<p>Generates a new system by adding a dumbbell interstitial point defect.</p>
<ol class="arabic simple">
<li><p>Copies the indicated atom and moves both the original and copy to the end of the Atoms list.</p></li>
<li><p>Displaces the dumbbell atoms position’s by +-db_vect.</p></li>
<li><p>Adds per-atom property old_id if it doesn’t exist corresponding to the atom ids in the original system.</p></li>
<li><p>Sets any of the new atom’s per-atom properties to values given as kwargs. Any undefined properties are left unchanged.</p></li>
</ol>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>system</strong> (<em>atomman.System</em>) The base System to add the defect to.</p></li>
<li><p><strong>pos</strong> (<em>array-like object, optional</em>) Position of the atom being modified. Either pos or ptd_id must be given.</p></li>
<li><p><strong>ptd_id</strong> (<em>int, optional</em>) Id of the atom to be modified. Either pos or ptd_id must be given.</p></li>
<li><p><strong>db_vect</strong> (<em>array-like object</em>) Vector shift to apply to the atoms in the dumbbell.</p></li>
<li><p><strong>scale</strong> (<em>bool, optional</em>) Indicates if pos and db_vect are Cartesian (False) or box-relative (True). Default value is False.</p></li>
<li><p><strong>atol</strong> (<em>float, optional</em>) Absolute tolerance for position-based searching. Default value is 1e-3 angstroms.</p></li>
<li><p><strong>**kwargs</strong> (<em>any, optional</em>) Keyword arguments corresponding to per-atom property values for the new atom in the dumbbell. By default, all properties are left unchanged (i.e. same as atom that was copied).</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.System</em>) A new system with the dumbbell added.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Turn atom 5 into a dumbbell</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">dumbbell</span><span class="p">(</span><span class="n">system</span><span class="p">,</span> <span class="n">ptd_id</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">db_vect</span><span class="o">=</span><span class="p">[</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">])</span>

<span class="c1"># Print system information</span>
<span class="nb">print</span><span class="p">(</span><span class="n">d_system</span><span class="o">.</span><span class="n">box</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natoms =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natypes =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="n">d_system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 8.220,  0.000,  0.000]
bvect =  [ 0.000,  8.220,  0.000]
cvect =  [ 0.000,  0.000,  8.220]
origin = [ 0.000,  0.000,  0.000]
natoms = 17
natypes = 2
</pre></div></div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
      <th>charge</th>
      <th>old_id</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>0</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>1</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>2</td>
    </tr>
    <tr>
      <td>3</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>3</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>4</td>
    </tr>
    <tr>
      <td>5</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>6</td>
    </tr>
    <tr>
      <td>6</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>7</td>
    </tr>
    <tr>
      <td>7</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>8</td>
    </tr>
    <tr>
      <td>8</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>9</td>
    </tr>
    <tr>
      <td>9</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>10</td>
    </tr>
    <tr>
      <td>10</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>11</td>
    </tr>
    <tr>
      <td>11</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>12</td>
    </tr>
    <tr>
      <td>12</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>13</td>
    </tr>
    <tr>
      <td>13</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>14</td>
    </tr>
    <tr>
      <td>14</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>15</td>
    </tr>
    <tr>
      <td>15</td>
      <td>2</td>
      <td>1.555</td>
      <td>5.665</td>
      <td>1.555</td>
      <td>1.0</td>
      <td>5</td>
    </tr>
    <tr>
      <td>16</td>
      <td>2</td>
      <td>2.555</td>
      <td>6.665</td>
      <td>2.555</td>
      <td>1.0</td>
      <td>16</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[7]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Show that dumbbell atoms are separated by 2 * db_vect</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;(d_system.atoms.pos[-1] - d_system.atoms.pos[-2]) / 2 -&gt;&quot;</span><span class="p">,</span> <span class="p">(</span><span class="n">d_system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">-</span> <span class="n">d_system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">])</span> <span class="o">/</span> <span class="mi">2</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
(d_system.atoms.pos[-1] - d_system.atoms.pos[-2]) / 2 -&gt; [0.5 0.5 0.5]
</pre></div></div>
</div>
</div>
<div class="section" id="6.-atomman.defect.point()">
<h2>6. atomman.defect.point()<a class="headerlink" href="#6.-atomman.defect.point()" title="Permalink to this headline">¶</a></h2>
<p>Generates a new System where a point defect has been inserted. Provides a common interface for the vacancy(), interstitial(), substitutional() and dumbbell() functions.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>system</strong> (<em>atomman.System</em>) The base System to add the defect to.</p></li>
<li><p><strong>ptd_type</strong> (<em>str, optional</em>) Key indicating which type of defect to add. Default value is ‘v’:</p>
<ul>
<li><p>‘v’ : vacancy.</p></li>
<li><p>‘i’ : positional interstitial.</p></li>
<li><p>‘s’ : substitutional.</p></li>
<li><p>‘db’ : dumbbell interstitial.</p></li>
</ul>
</li>
<li><p><strong>pos</strong> (<em>array-like object, optional</em>) Position for adding the defect atom (all styles).</p></li>
<li><p><strong>ptd_id</strong> (<em>int, optional</em>) Atom id where defect is added. Alternative to using pos (‘v’, ‘s’, ‘db’ styles).</p></li>
<li><p><strong>db_vect</strong> (<em>array-like object, optional</em>) Vector associated with the dumbbell interstitial (‘db’ style).</p></li>
<li><p><strong>scale</strong> (<em>bool, optional</em>) Indicates if pos and db_vect are Cartesian (False) or box-relative (True). Default value is False.</p></li>
<li><p><strong>atol</strong> (<em>float, optional</em>) Absolute tolerance for position-based searching. Default value is 1e-3 angstroms.</p></li>
<li><p><strong>**kwargs</strong> (<em>any, optional</em>) Keyword arguments corresponding to per-atom property values for the new/modified atom (‘i’, ‘s’, ‘db’ styles).</p></li>
</ul>
<p>Raises</p>
<ul class="simple">
<li><p>(<em>AssertionError</em>) If parameters are given for styles that don’t allow them.</p></li>
<li><p>(<em>ValueError</em>) If an invalid ptd_type is given.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.System</em>) A new system containing the defect.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Use point() to make atom 7 a dumbbell of two atoms of atype 3</span>

<span class="c1"># ptd_type &#39;s&#39; changes atom 7 and moves to last atom</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">point</span><span class="p">(</span><span class="n">system</span><span class="p">,</span> <span class="s1">&#39;s&#39;</span><span class="p">,</span> <span class="n">ptd_id</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">atype</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">charge</span><span class="o">=-</span><span class="mf">0.5</span><span class="p">)</span>

<span class="c1"># ptd_type &#39;db&#39; turns last atom into dumbbell, copying per-atom properties</span>
<span class="n">d_system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">defect</span><span class="o">.</span><span class="n">point</span><span class="p">(</span><span class="n">d_system</span><span class="p">,</span> <span class="s1">&#39;db&#39;</span><span class="p">,</span> <span class="n">ptd_id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">db_vect</span><span class="o">=</span><span class="p">[</span><span class="mf">0.6</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">])</span>

<span class="c1"># Print system information</span>
<span class="nb">print</span><span class="p">(</span><span class="n">d_system</span><span class="o">.</span><span class="n">box</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natoms =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;natypes =&#39;</span><span class="p">,</span> <span class="n">d_system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="n">d_system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 8.220,  0.000,  0.000]
bvect =  [ 0.000,  8.220,  0.000]
cvect =  [ 0.000,  0.000,  8.220]
origin = [ 0.000,  0.000,  0.000]
natoms = 17
natypes = 3
</pre></div></div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
      <th>charge</th>
      <th>old_id</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>0</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>1</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>2</td>
    </tr>
    <tr>
      <td>3</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>3</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>4</td>
    </tr>
    <tr>
      <td>5</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>1.0</td>
      <td>5</td>
    </tr>
    <tr>
      <td>6</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>-1.0</td>
      <td>6</td>
    </tr>
    <tr>
      <td>7</td>
      <td>1</td>
      <td>0.000</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>8</td>
    </tr>
    <tr>
      <td>8</td>
      <td>2</td>
      <td>2.055</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>9</td>
    </tr>
    <tr>
      <td>9</td>
      <td>1</td>
      <td>4.110</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>10</td>
    </tr>
    <tr>
      <td>10</td>
      <td>2</td>
      <td>6.165</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>11</td>
    </tr>
    <tr>
      <td>11</td>
      <td>1</td>
      <td>0.000</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>12</td>
    </tr>
    <tr>
      <td>12</td>
      <td>2</td>
      <td>2.055</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>13</td>
    </tr>
    <tr>
      <td>13</td>
      <td>1</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>4.110</td>
      <td>-1.0</td>
      <td>14</td>
    </tr>
    <tr>
      <td>14</td>
      <td>2</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>6.165</td>
      <td>1.0</td>
      <td>15</td>
    </tr>
    <tr>
      <td>15</td>
      <td>3</td>
      <td>5.565</td>
      <td>6.165</td>
      <td>1.455</td>
      <td>-0.5</td>
      <td>7</td>
    </tr>
    <tr>
      <td>16</td>
      <td>3</td>
      <td>6.765</td>
      <td>6.165</td>
      <td>2.655</td>
      <td>-0.5</td>
      <td>16</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Introduction to atomman: Point defect generation</a><ul>
<li><a class="reference internal" href="#1.-Introduction">1. Introduction</a></li>
<li><a class="reference internal" href="#2.-atomman.defect.vacancy()">2. atomman.defect.vacancy()</a></li>
<li><a class="reference internal" href="#3.-atomman.defect.interstitial()">3. atomman.defect.interstitial()</a></li>
<li><a class="reference internal" href="#4.-atomman.defect.substitutional()">4. atomman.defect.substitutional()</a></li>
<li><a class="reference internal" href="#5.-atomman.defect.dumbbell()">5. atomman.defect.dumbbell()</a></li>
<li><a class="reference internal" href="#6.-atomman.defect.point()">6. atomman.defect.point()</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="4._Defect_creation_and_analysis.html"
                        title="previous chapter">Introduction to atomman: Defect creation and analysis</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="4.2._Free_surface_generator.html"
                        title="next chapter">Introduction to atomman: Free surface generator</a></p>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="4.2._Free_surface_generator.html" title="Introduction to atomman: Free surface generator"
             >next</a> |</li>
        <li class="right" >
          <a href="4._Defect_creation_and_analysis.html" title="Introduction to atomman: Defect creation and analysis"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" >Tutorials</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0.
    </div>
  </body>
</html>